import router from '@system.router';
import prompt from '@system.prompt';

export default {
    data: {
        pageWord: {
            shopingCart: '购物车',
            settlement: '结算',
        },
        priceTotal: 0,
        latestList: [],
        newTitle:'',
        newPrice:'',
        hotList: [
            {
                title: '洞洞鞋 2022新款 ',
//                content: '10:08限时开售',
                color:'黑色',
                number:'1',
                price: '99',
                size:'37码',
                imgSrc: "/common/shoes/shoes1.jpg"
            },
//            {
//                title: '洞拖 设计感 ',
//                //                content: '10:08限时开售',
//                color:'粉色',
//                number:'1',
//                price: '59',
//                size:'37码',
//                imgSrc: "/common/shoes/shoes2.jpg"
//            },
//    {
//                title: '洞洞鞋 2022新款 ',
//                //                content: '10:08限时开售',
//                color:'黑色',
//                number:'1',
//                price: '99',
//                size:'37码',
//                imgSrc: "/common/shoes/shoes1.jpg"
//            },
//            {
//                title: '洞洞鞋 2022新款 ',
//                //                content: '10:08限时开售',
//                color:'黑色',
//                number:'1',
//                price: '99',
//                size:'37码',
//                imgSrc: "/common/shoes/shoes1.jpg"
//            },

        ],
        fineProductList: [{}],
        wisdomList: [{}],
        allList: [],

        iconImageFlag: 1,
    },

    change(e) {
        this.allList = [];
//        if (e.index === this.zeroFlag) {
            this.allList = [...this.hotList, ...this.fineProductList, ...this.wisdomList];
//        } else if (e.index === this.oneFlag) {
//            this.allList = this.hotList;
//        } else if (e.index === this.twoFlag) {
//            this.allList = this.fineProductList;
//        } else if (e.index === this.threeFlag) {
//            this.allList = this.wisdomList;
//        }
    },
    onInit() {
//        this.latestList = [...this.hotList]
        this.latestList = [...this.hotList, ...this.fineProductList, ...this.wisdomList]
        this.allList = [...this.hotList, ...this.fineProductList, ...this.wisdomList]
//        console.info(this.newTitle);
        if(this.newTitle==''){
            this.newTitle='【新品】洞洞鞋 2022款'
        }
        if(this.newPrice==''){
            this.newPrice='99'
        }

    },
    detailPage() {
        router.push({
            uri: "pages/detail/detail"
        });
    },
    clickSettlement() {
        router.push({
            uri: "pages/ordersubmit/ordersubmit"
        })
    },
    stickFloat() {
    },
    //合计结算
    addShopping(e) {
        if (e.checked) {
            this.priceTotal += parseInt(e.target.attr.value);
        } else {
            this.priceTotal -= parseInt(e.target.attr.value);
        }
    },
    backPage() {
        router.back();
    },


}